package com.hitqz.robot.biz.util;

import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;

public class EncrUtils {
    static byte[] key = SecureUtil.generateKey("AES").getEncoded();
    // 2. 构建AES加密器
    static AES aes = SecureUtil.aes(key);

    public static String encrypt(String plainText) {
        // 1. 生成随机密钥（16字节）



        String encrypted = aes.encryptHex(plainText);


        return encrypted;
    }

    public static String decrypt(String cipherText) {
        // 4. 解密数据
        String decrypted = aes.decryptStr(cipherText);
        return decrypted;
    }

}
